import React, { useEffect, useState } from 'react'
import './index.scss'
import axios from '../../../../utils/axios'
import T from 'prop-types'
import format from '../../../../utils/format'
export default function UserCard(props) {
  const { info = {} } = props
  useEffect(() => {
    // getInfo()
  }, [])

  return (
    <div className="user-card">
      <img src={info.avatar} alt="=_=" />
      <div className="header-name">
        <div>{info.username}</div>
        <div className={'header-name-time'}>
          {format(info.createTime, 'yyyy-MM-dd HH:mm:ss')}
          {/* {new Date(info.createTime)} */}
        </div>
      </div>
    </div>
  )
}

UserCard.propTypes = {
  info: T.object,
}
